package cn.wolfcode.productdemo;

import org.apache.rocketmq.spring.core.RocketMQTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description: 一次性发送
 * @Author: 伍家钰
 * @Date: 2020/9/4 10:47
 * @Version: 1.0
 */
@RestController
public class OneWayProductController {
    @Autowired
    private RocketMQTemplate rocketMQTemplate;

    @RequestMapping("oneWay")
    public String sendOneWay(String msg) {
        rocketMQTemplate.sendOneWay("03-boot-hello", msg);
        System.out.println("发送成功");
        return "success";
    }
}
